	import {
		mapGetters
	} from 'vuex'

	export default {
		// onLoad() {}, onLoad 只加载一次
		// 需要用onShow,在页面显示的时候加载徽标
		onShow() {
			uni.setTabBarBadge({
				index: 2,
				text: this.getAllGoodsCount + ''
			})
		},
		computed: {
			...mapGetters('m_cart', ['getAllGoodsCount'])
		},
		watch: {
			// 统计商品总数量
			getAllGoodsCount() {
				uni.setTabBarBadge({
					index: 2,
					text: this.getAllGoodsCount + ''
				})
			}
		}
	}